package com.cn.wanxi.service;

import com.cn.wanxi.dao.NavDao;
import com.cn.wanxi.model.NavModel;

import java.util.ArrayList;
import java.util.List;

public class NavService {
    public NavModel getNavModel() {
        NavModel navModel = new NavModel();
        NavDao navDao = new NavDao();
//        navModel.setShouye(navDao.getShouye());
//        navModel.setJieshao(navDao.getJieshao());
//        navModel.setNews(navDao.getNews());
        return navModel;
    }

    public List<String> getList() {
        List<String> list = new ArrayList<>();
        NavDao navDao = new NavDao();
//        list.add(navDao.getShouye());
//        list.add(navDao.getJieshao());
//        list.add(navDao.getNews());
        return list;

    }

    public static void main(String[] args) {
        new NavDao();
    }

    /**
     * 封装导航数据
     *
     * @return
     */
    public List<NavModel> getNavModelList() {
        List<NavModel> list = new ArrayList<>();
        NavDao navDao = new NavDao();
        for (int i = 0; i < navDao.hrefs.length; i++) {
            NavModel model = new NavModel();
            model.setHref(navDao.hrefs[i]);
            model.setTitle(navDao.titles[i]);
            list.add(model);
        }
//        NavModel model = new NavModel();
//        model.setHref("");
//        model.setTitle("");
//        list.add(model);
//        NavModel model1 = new NavModel();
//        model1.setHref("");
//        model1.setTitle("");
//        list.add(model1);
//        NavModel model2 = new NavModel();
//        model2.setHref("");
//        model2.setTitle("");
//        list.add(model2);
        return list;
    }
}
